package com.ourcraft.informationcollectionsystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import java.util.Date;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@TableName("DataReportFormHistory")
public class DataReportFormHistory {
    @TableId(type = IdType.AUTO)
    private Integer historyId;
    private Integer formId;
    private Integer userId;
    private Integer historyType;
    private String historyComment;
    @TableField(value = "history_date", jdbcType = JdbcType.TIMESTAMP)
    private Date historyDate;

    public DataReportFormHistory(Integer formId, Integer userId, Integer historyType, String historyComment) {
        this.formId = formId;
        this.userId = userId;
        this.historyType = historyType;
        this.historyComment = historyComment;
        this.historyDate = new Date();
    }
}
